home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_lag_armdevice.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  93 lines

  1. # Jones 3D Cog Script
  2. #
  3. # lag_armdevice.cog
  4. #
  5. # [DS]
  6. #
  7. # (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
  8. #
  9. # =======================================================================================
  10.  
  11. symbols
  12.     message    startup
  13.     message    touched
  14.     message    activated
  15.  
  16.        thing        bumpit0
  17.     thing        armdevice
  18.  
  19.     keyframe    in_reach=in_pickup_low.key            local
  20.     sound        foundSnd=INXJ254.wav                local
  21.     sound        ahaSnd=INXJ147.wav                local # Aha...
  22.     sound        bumpwav0=inxj003.wav                local
  23.     sound        bumpwav1=inxj141.wav                local
  24.     thing        player                        local
  25.     int        talking=0                        local
  26.     int        sndnum                        local
  27.     int        numsounds=2                        local
  28.     int        tryit                            local
  29.  
  30. end
  31.  
  32. # ========================================================================================
  33.  
  34. code
  35. startup:
  36.     player = GetLocalPlayerThing();
  37.     return;
  38.  
  39. activated:
  40.     if (GetSenderRef() != bumpit0) return;
  41.     if(talking == 2) return;
  42.     StopSound(tryit, 0.01);
  43.     talking=2;
  44.     StartCutscene(0);
  45.     SetActorFlags(player, 0x200000);
  46.     StopThing(player);
  47.     DeselectWeaponWait(player);
  48.     PlayVoice(player, ahaSnd, 1.0, 0);
  49.  
  50.     # ----- Set Cam Offset ---------
  51.     if (Rand() < 0.5)
  52.     {
  53.         SetExtCamOffset('0.15 -0.05 0.04');
  54.     }
  55.     else
  56.     {
  57.         SetExtCamOffset('-0.15 -0.05 0.04');
  58.     }
  59.     SetExtCamLookOffset('0.0 0.02 0.0');
  60.  
  61.     PlayKey(player, in_reach, 4, 0x12, 0);
  62.     sleep(0.6);
  63.     DestroyThing(armdevice);
  64.  
  65.     # ----- Add Arm Device --------
  66.     ChangeInv(player, 60, 1.0);
  67.     SetInvAvailable(player, 60, 1);
  68.     JonesInvItemChanged(60);
  69.     Sleep(1.0);
  70.     PlayVoice(player, foundSnd, 1.0, 1);
  71.  
  72.     # ----- Reset Camera ----------
  73.     RestoreExtCam();
  74.     ClearActorFlags(player, 0x200000);
  75.     EndCutscene();
  76.     return;
  77.  
  78.  
  79. touched:
  80.     if (GetSenderRef() != bumpit0) return;
  81.     if(talking >= 1) return;
  82.     sndnum = rand()*numsounds;
  83.     talking=1;
  84.     tryit = PlayVoice(player, bumpwav0[sndnum], 1.0, 0);
  85.     WaitForSound(tryit);
  86.     sleep(10);
  87.     if(talking == 2) return;
  88.     talking=0;
  89.     return;
  90.  
  91. end
  92.  
  93.